<aside class="main-sidebar">
    <section class="sidebar">
        <!-- 侧边栏菜单 -->
        <ul class="sidebar-menu" data-widget="tree">
            <li class="header" style="color:#ffffff">菜单</li>
            <!-- jinja2生成菜单 -->
            {% for group in session['menu'] %}
                {% for key,nodes in group.items() %}
                    {% if key == 'index' %}
                        {% for i in nodes %}
                            <li><a href="{{ i.url }}"><i class="fa {% if i.icon %}{{ i.icon }}{% else %}fa-circle-o{% endif %}"></i> <span>{{ i.name }}</span></a></li>
                        {% endfor %}
                    {% else %}
                        <li class="treeview">
                            <a href="#">
                                <i class="fa {{ key|icon(1) }}"></i> <span>{{ key|icon(0) }}</span>
                                <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                            </a>
                            <ul class="treeview-menu">
                                {% for i in nodes %}
                                    <li><a href="{{ i.url }}"><i class="fa {% if i.icon %}{{ i.icon }}{% else %}fa-circle-o{% endif %}"></i>{{ i.name }}</a>
                                    </li>
                                {% endfor %}
                            </ul>
                        </li>
                    {% endif %}
                {% endfor %}
            {% endfor %}
        </ul>
    </section>
</aside>